package com.pianzhu.blockchainemr.mapper;

import com.pianzhu.blockchainemr.pojo.*;
import com.pianzhu.blockchainemr.pojo.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface DoctorMapper {

    /**
     * 分页查询我的患者列表
     */
    List<PatientResult> getMyPatients(
            @Param("doctorId") Long doctorId,
            @Param("patientName") String patientName,
            @Param("visitId") String visitId);

    /**
     * 获取我的患者总数
     */
    Long getMyPatientsCount(@Param("doctorId") Long doctorId);

    /**
     * 根据就诊ID获取授权信息
     */
    EmrDocumentsEmpower getEmpowerByVisitId(@Param("visitId") String visitId, @Param("doctorId") Long doctorId);

    String getPatientAged(String patientId);

    void discharge(String visitId);

    void transfer(String visitId, Integer hospitalId);

    void cancel(String visitId);

    void dead(String visitId);

    List<MedicalRecordListResult> getMedicalRecord(String visitId);

    String isEmpower(Integer doctorId, String docId);

    MedicalRecordInfo getMedicalRecordInfo(String docId);

    String selectRealNameByPatientId(String patientId);

    String selectRealNameById(Integer doctorId);

    String selectDeptNameByDeptCode(String deptCode);

    void requestEmpower(String visitId, Integer doctorId, Integer docId);

    String getChiefComplaint(String visitId);

    List<MedicalReportListResult> getMedicalReport(String visitId);

    String isReportEmpower(Integer doctorId, String reportId);

    MedicalReportInfo getMedicalReportInfo(String reportId);

    void requestMedicalReportEmpower(String visitId, Integer doctorId, Integer reportId);

    List<PatientResult> searchPatients(@Param("doctorId") Long doctorId,@Param("keyword") String keyword);

    String getHospitalName(Integer hospitalId);

    void newMedicalRecord(EmrDocuments emrDocuments);


    Integer getDocIdByVisitIdAndTitle(String visitId, String docTitle);

    void updateEmpowerStatus(Integer docId, Integer doctorId, String isEmpower);

    /**
     * 新建检查检验报告
     */
    void newMedicalReport(EmrExamReports emrExamReports);

    EmrDocumentsEmpower getEmpowerByVisitIdAndDoctorId(String visitId, Long doctorId);

    List<EmrExamItemDict> getItemList();

    void inVisit(String visitId);

    List<EmrMedOrders> getPrescriptionList(String patientId);

    void createPrescription(EmrMedOrders emrMedOrders);

    EmrPatMaster getPatientInfo(String patientId);

    List<EmrDrugDict> getDrugList();

    List<EmrMedVisit> getVisitList(String patientId, Integer doctorId);

    List<EmrMedOrders> getMyPrescriptionList(String doctorId);

    void deletePrescription(long orderId);

    void updatePrescription(EmrMedOrders emrMedOrders);
}